import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase="DBshop047_编辑积分规则"
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,"客户管理","管理积分","积分规则")
firefox.find_element_by_xpath("//td[text()='遵守规则']/following-sibling::td[4]/a[1]").click()
firefox.find_element_by_id("integral_rule_info").clear()
firefox.find_element_by_id("integral_rule_info").send_keys("好好学习")
firefox.find_element_by_xpath("(//button[contains(.,'保存积分规则')])[2]").click()

try:
    firefox.find_element_by_xpath("//td[text()='遵守规则']/following-sibling::td").text=="好好学习"
    writeLog("%s 测试通过" % testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
